[Bugfix #804] vscode: don't force-create a second editor group for builder terminals - #1041
Merged
Conversation
… only if it exists openTerminal's else-branch (builder/shell types) unconditionally targeted vscode.ViewColumn.Two. Because that column is fixed by ordinal, VS Code force-created a second editor group whenever the user had only one open, reshaping their layout on every spawn. Now the branch checks vscode.window.tabGroups.all.length: it targets ViewColumn.Two only when a second group already exists, else falls back to ViewColumn.One (the first/default group). Architect (ViewColumn.One) and dev/panel terminals are untouched. Adds 3 source-level regression tests matching this file's existing pattern.
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spawning a builder (or shell) terminal unconditionally targeted
vscode.ViewColumn.Two. Because that column is fixed by ordinal, VS Code force-created a second editor group whenever the user had only one open — reshaping their layout on every spawn.openTerminal'selse-branch now checksvscode.window.tabGroups.all.length:ViewColumn.Two(unchanged behavior).ViewColumn.One(first/default group) instead of forcing a new group into existence.Architect terminals (
ViewColumn.One) and dev / panel terminals are untouched.Acceptance criteria
elsebranch).ViewColumn.One) and dev / panel terminals untouched.show(!focus)semantics preserved (only the target column changed).Tests
3 source-level regression tests added to
terminal-manager.test.ts, matching that file's established pattern (constructing a fullTerminalManagerrequires heavy vscode mocking, so the suite asserts on source structure). They guard thetabGroups.all.length >= 2gate and the Two/One fallback, and fail if the unconditionalViewColumn.Twoassignment returns.pnpm test:unit terminal-manager→ 15 passed.pnpm check-types→ clean. Porch checks (build + tests) → pass.Note on related work
Per #803 (builder terminal unopenable after move-between-groups + close — same area of code), these PRs should stay sequenced. This change only touches the spawn-time column selection in the
else-branch; it does not alter the move/close handling #803 addresses.Implementation note
The issue proposed a ternary for the column selection; this PR uses an
if/elseinstead, consistent with the codebase style guidance to avoid ternaries.Fixes #804
🤖 Generated with Claude Code